/**
 * 安卓白金英雄坛制作组 <br>
 * 文件名：BasicScreen.java <br>
 * 创建时间：2013-9-7 下午1:06:15 <br>
 * 所属项目：GmudEX <br>
 * @author 12548 <br>
 */
package lostland.gmud.exv2.blgframework;

import lostland.gmud.exv2.Game;

/**
 * 类名：BasicScreen <br>
 * 说明：主屏（流程控制）
 *
 * @author 12548
 */
public abstract class BasicScreen {

	private static boolean timeFlowing = false;


	/**
	 * @param gameTime 要设置的 gameTime
	 */
	public static void timeFlow(float time) {
//		if(Gmud.mc.equips(Room.super_toys[8]))
//			// 十玩具8：崆峒印
//			return;

		if (Game.getData() == null) return;
		float time_multiplier = 1f;
		Game.getData().stat_time += time;
		Game.getData().hour += time * time_multiplier;
		Game.getData().hungerTime += time * time_multiplier;
		Game.getData().stoneTime += time;
	}

	public abstract void update(float deltaTime);


	public void render(float deltaTime) {
		if (isTimeFlowing()) {
			timeFlow(deltaTime);
		}
		update(deltaTime);
	}

	public abstract boolean isStable();

	public static Game getGame() {
		return Game.getInstance();
	}

	public static boolean isTimeFlowing() {
		return timeFlowing;
	}

	public static void setTimeFlowing(boolean b) {
		timeFlowing = b;
	}


}
